﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Item.Master" AutoEventWireup="true" CodeBehind="AssociatedDepts.aspx.cs" 
Inherits="SGDemo.Permission.AssociatedDepts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHeader" runat="server">
    <script src="AssociatedDepts.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpBody" runat="server">
    <div class="ui-menu">
        <uc:Menu ID="menu1" runat="server" DataFile="../Views/Permission/Menu/AssociatedDepts.xml"
            PageCode="AssociatedDepts" />
    </div>
    <div class="ui-wrapper">
        <div class="ui-hidden">
            <dx:ASPxLabel ID="lblKeyid" ClientInstanceName="lblKeyid" runat="server" />
        </div>
        <ul class="ui-list">
           <li>
                <dx:ASPxLabel ID="lblun" runat="server" Text="用户名称：" AssociatedControlID="txtUsername" />
            </li>
            <li>
                <dx:ASPxTextBox ID="txtUsername" ClientInstanceName="txtUsername" runat="server" Enabled="false"
                    Width="120px">
                </dx:ASPxTextBox>
               
            </li>
             <li>
                <dx:ASPxLabel ID="lblrn" runat="server" Text="真实姓名：" AssociatedControlID="txtRealname" />
            </li>
            <li>
                <dx:ASPxTextBox ID="txtRealname" ClientInstanceName="txtRealname" runat="server" Enabled="false"
                    Width="120px">
                </dx:ASPxTextBox>
              
            </li>
            <li>
                
            </li>
            <li>
               
            </li>
            <li>
                
            </li>
            <li>
               
            </li>
        </ul>
        <div id="listall" class="ui-content-item ui-content-item-selected">
            <%--gvwList--%>
            <dx:ASPxGridView ID="gvwList" ClientInstanceName="gvwList" runat="server" AutoGenerateColumns="False"
                DataSourceID="odsList" Width="100%" KeyFieldName="Keyid"
                OnCustomCallback="gvwList_CustomCallback">
                <Columns>
                    <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" HeaderStyle-HorizontalAlign="Center" Width="40">
                        <HeaderTemplate>
                            <dx:ASPxCheckBox ID="cbSelectAll" runat="server">
                                <ClientSideEvents CheckedChanged="doSelectOrUnselectAll" />
                            </dx:ASPxCheckBox>
                        </HeaderTemplate>
                    </dx:GridViewCommandColumn>
                    <dx:GridViewDataColumn Caption="部门名称" FieldName="DeptName" VisibleIndex="1" Width="120">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="部门编码" FieldName="DeptCode" VisibleIndex="2" Width="80">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="助记码" FieldName="HelpCode" VisibleIndex="3" Width="80">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="类别" VisibleIndex="4">
                        <DataItemTemplate>
                            <%# ProcessDeptType(Eval("DeptType").ToString())%>
                        </DataItemTemplate>
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="联系人" FieldName="Contact" VisibleIndex="5" Width="100">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="备注" FieldName="Remark" VisibleIndex="6">
                    </dx:GridViewDataColumn>
                </Columns>
                <ClientSideEvents SelectionChanged="doSelectionChanged"/>
                <SettingsBehavior AllowFocusedRow="true" />
                <SettingsLoadingPanel Text="加载中..." />
                <SettingsPager PageSize="10" Mode="ShowPager" Summary-Text="当前第{0}页，共{1}页(共{2}条)"></SettingsPager>
                <SettingsText EmptyDataRow="没有数据显示" />
                <Styles>
                <AlternatingRow Enabled="True"/>
                </Styles>
            </dx:ASPxGridView>
            <%--数据源控件--%>
            <asp:ObjectDataSource ID="odsList" runat="server"
                SelectMethod="GetDeptByUserKeyid" TypeName="SGDemo.Permission.AssociatedDeptsDataSource">
                <SelectParameters>
                    <asp:QueryStringParameter Name="keyid" Type="String" QueryStringField="Keyid" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
    </div>
</asp:Content> 
